/*************************************************************************
	> File Name: P9749.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-02-13 15:24:50
 ************************************************************************/
#include <iostream>
#include <cmath>
using namespace std;

#define MAX_N 100000
int dis[MAX_N + 5];
int val[MAX_N + 5];

int main() {
    int n, d;
    cin >> n >> d;
    for (int i = 1; i < n; i++) {
        scanf("%d", dis + i);
    }
    for (int i = 1; i <= n; i++) {
        scanf("%d", val + i);
    }
    long long ans = 0, res = 0;
    int min_money = val[1];
    for (int i = 1; i < n; i++) {
        min_money = min(min_money, val[i]);
        int need = ceil((dis[i] - res) * 1.0 / d);
        ans += need * min_money;
        res = need * d + res - dis[i];
    }
    cout << ans << endl;
    return 0;
}
